package org.dey.controller;


import org.dey.entity.Result;
import org.dey.pojo.User;
import org.dey.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author deyran
 * @classname
 * @see UserController
 */
@RestController
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping ("login.do")
    public Result<User> User(@RequestBody User user){
        return userService.LOGIN(user);
    }

    @GetMapping("user.do")
    public List<User> Users() {
        return userService.USER_LIST();
    }
}
